import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '../views/HomeView.vue'


Vue.use(VueRouter);

const routes = [


    {
        path: '/',
        name: 'home',
        component: Home,
    },
    {
        path: '/home',
        name: 'home',
        component: Home,
        redirect: '/home', // 该配置是若点击选择父目录时，默认选中该父目录下的子路径页面
        children: [
               // 第1个   
            {
                // 第一个二级
                path: '/test1',
                component: () => import('../page/test1/index.vue'),
                meta: {
                    title: '客户管理'
                },
                redirect: '/test1/yibiaopan', // 该配置是若点击选择一级菜单时，默认选中并跳转到该一级菜单下的第一个二级菜单
                children: [
                    {
                        path: '/yibiaopan',
                        component: () => import('../page/test1/yibiaopan.vue'),
                        meta: {
                            title: '仪表盘'
                        },
                    },
                    {
                        path: '/daiban',
                        component: () => import('../page/test1/daiban.vue'),
                        meta: {
                            title: '待办事项'
                        },
                    },
                    {
                        path: '/xiansuo',
                        component: () => import('../page/test1/xiansuo.vue'),
                        meta: {
                            title: '线索'
                        },
                    },
                    {
                        path: '/kehu',
                        component: () => import('../page/test1/kehu.vue'),
                        meta: {
                            title: '客户'
                        },
                    },
                    {
                        path: '/lianxiren',
                        component: () => import('../page/test1/lianxiren.vue'),
                        meta: {
                            title: '联系人'
                        },
                    },
                    {
                        path: '/shangji',
                        component: () => import('../page/test1/shangji.vue'),
                        meta: {
                            title: '商机'
                        },
                    },
                    {
                        path: '/hetong',
                        component: () => import('../page/test1/hetong.vue'),
                        meta: {
                            title: '合同'
                        },
                    },
                    {
                        path: '/huikuan',
                        component: () => import('../page/test1/huikuan.vue'),
                        meta: {
                            title: '回款'
                        },
                    },
                    {
                        path: '/fapiao',
                        component: () => import('../page/test1/fapiao.vue'),
                        meta: {
                            title: '发票'
                        },
                    },
                    {
                        path: '/huifang',
                        component: () => import('../page/test1/huifang.vue'),
                        meta: {
                            title: '回访'
                        },
                    },
                    {
                        path: '/chanping',
                        component: () => import('../page/test1/chanping.vue'),
                        meta: {
                            title: '产品'
                        },

                    },
                ],

            },
               // 第二个   
            {
                path: '/test2',
                component: () => import('../page/test2/index.vue'),
                meta: {
                    title: '任务/审批'
                },
                redirect: '/test2/mytask',
                //  二级子路由——我的任务
                children: [
                    {
                        path: '/mytask',
                        component: () => import('../page/test2/MyTask.vue'),
                        meta: {
                            title: '任务/审批'
                        },
                    },
                    //  二级子路由——下属的任务
                    {
                        path: '/xiashutask',
                        // name:'xiashutask',
                        component: () => ('../page/test2/XiaShuTask.vue'),
                        meta: {
                            title: '全部'
                        },
                    },
                    //  二级子路由——我发出的审批
                    {
                        path: '/sendtask',
                        // name:'sendtask',
                        component: () => import('../page/test2/SendAudit.vue'),
                        meta: {
                            title: '全部'
                        },
                    },
                    //  二级子路由——待我审批(办公)
                    {
                        path: '/waitaudit',
                        // name:'waitaudit',
                        component: () => import('../page/test2/WaitAudit.vue'),
                        meta: {
                            title: '全部'
                        },
                    },
                ],

            },
             // 第3个  

        ],
     

    },
]


        const router = new VueRouter({
            routes
        })


export default router
